/*
 * AbstractStatusBar.java
 *
 * Copyright 2007, 2008 Tiberiumlabs
 *
 * This file is part of Tiberiumlabs Lailaps.
 *
 * Tiberiumlabs Lailaps is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Tiberiumlabs Lailaps is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.tiberiumlabs.lailaps.gui.elements;

import java.awt.Font;
import java.util.ResourceBundle;
import javax.swing.JLabel;
import javax.swing.JPanel;
import org.tiberiumlabs.lailaps.Mediator;
import org.tiberiumlabs.lailaps.toolkit.StateManager;

/**
 *
 * @author <a href="mailto:paranoid.tiberiumlabs@gmail.com">Paranoid</a>
 */
public class AbstractStatusBar extends JPanel {

    private StateManager stateManager = Mediator.getMediator().getStateManager();
    public static final Font PLAIN_FONT_10 = new Font(Font.SANS_SERIF, Font.PLAIN, 10);
    public static final Font BOLD_FONT_10 = new Font(Font.SANS_SERIF, Font.BOLD, 10);
    public static final Font PLAIN_FONT_11 = new Font(Font.SANS_SERIF, Font.PLAIN, 11);
    public static final Font BOLD_FONT_11 = new Font(Font.SANS_SERIF, Font.BOLD, 11);

    public AbstractStatusBar() {
        super();
        
        ResourceBundle bundle = ResourceBundle.getBundle("org/tiberiumlabs/lailaps/resources/messages/statusbar");
        totalLabel.setToolTipText(bundle.getString("total.tooltip") + ' ' + stateManager.getTotal());
        stoppedLabel.setToolTipText(bundle.getString("stopped.tooltip") + ' ' + stateManager.getStopped());
        workingLabel.setToolTipText(bundle.getString("working.tooltip") + ' ' + stateManager.getWorking());
        completedLabel.setToolTipText(bundle.getString("completed.tooltip") + ' ' + stateManager.getCompleted());
        
    }

    protected final JLabel totalLabel = new JLabel(String.valueOf(stateManager.getTotal()));
    protected final JLabel completedLabel = new JLabel(String.valueOf(stateManager.getCompleted()));
    protected final JLabel stoppedLabel = new JLabel(String.valueOf(stateManager.getStopped()));
    protected final JLabel workingLabel = new JLabel(String.valueOf(stateManager.getWorking()));

    public JLabel getTotalLabel() {
        return totalLabel;
    }

    public JLabel getCompletedLabel() {
        return completedLabel;
    }

    public JLabel getStoppedLabel() {
        return stoppedLabel;
    }

    public JLabel getWorkingLabel() {
        return workingLabel;
    }
    
}